{if !empty($data)}
    {!$data}
{* json encode everything? *}
{elseif !empty($directory)}
    <directory>
    {foreach $directory as $file}
        <file>
            <owner>{$file->fileInfo->ownerName}</owner>
            <hidden>{$file->fileInfo->hidden}</hidden>
            <protected>{$file->fileInfo->protected}</protected>
            <size>{$file->size}</size>
            <mimeType>{$file->mimetypeText}</mimeType>
            <url>{$file->url}</url>
            <name>{$file->name}</name>
        </file>
    {/foreach}
    </directory>
{elseif !empty($file)}
    <file>
       <owner>{$file->fileInfo->ownerName}</owner>
       <hidden>{$file->fileInfo->hidden}</hidden>
       <protected>{$file->fileInfo->protected}</protected>
       <size>{$file->size}</size>
       <mimeType>{$file->mimetypeText}</mimeType>
       <url>{$file->url}</url>
       <name>{$file->name}</name>
    </file>
{/if}

